class CreateAcademicTerms < ActiveRecord::Migration
  def self.up
    create_table :academic_terms do |t|
      t.text :name
      t.string :abbreviation
      t.string :code
      t.references :term
      t.date :starts
      t.date :ends

      t.timestamps
    end
    add_index(:academic_terms, :code, :unique => true)
  end

  def self.down
    remove_index(:academic_terms, :column => :code)
    drop_table :academic_terms
  end
end
